﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyStores.aspx.cs" Inherits="ModernShopping.User.MyStores" MasterPageFile="~/ModernShopping.Master" %>

<asp:Content runat="server" ContentPlaceHolderID="HeaderContent">
    <style type="text/css">
        .style {
            padding-left: 10px;
        }
    </style>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <meta charset="utf-8" />
    <link href="../Css/GoogleMap.css" rel="stylesheet" />
    <link href="../Css/ModernShopping.css" rel="stylesheet" />
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places,geometry"></script>
    <script type="text/javascript" src="../Scripts/ContextMenu.js"></script>
    <script type="text/javascript" src="../Scripts/GoogleMap.js"></script>
    <script type="text/javascript" src="../Scripts/ajaxLoader.js"></script>
    <script type="text/javascript" src="../Scripts/jquery-1.9.1.js"></script>
    <script>
        var geocoder;
        var map;
        var myStyles = [{
            featureType: "poi",
            elementType: "labels.icon",
            stylers: [{ visibility: "off" }]
        }
        ];
        function initialize() {
            var mapOptions = {
                center: new google.maps.LatLng(10.84993423147865, 106.771693564418),
                zoom: 17,
                mapTypeId: google.maps.MapTypeId.ROADMAP,
                draggableCursor: 'crosshair',
                disableDoubleClickZoom: true,
                mapMaker: true

            };
            geocoder = new google.maps.Geocoder();
            map = new google.maps.Map(document.getElementById('map_canvas'),
              mapOptions);
            createContextMenuForMap();
            createContextMenuForMarker();
            initAutocomplete();
        }
        google.maps.event.addDomListener(window, 'load', initialize);

        function reloadIframe() {
            var iframe = document.get
        }

    </script>
</asp:Content>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="MainContent">
    <div class="div-center">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div class="title">
            <asp:Label ID="Label1"
                runat="server"
                Text="DANH SÁCH CỬA HÀNG" Width="100%" BorderStyle="None" />
        </div>
        <div class="add-product">
            <div style="width: 90%; margin: 30px auto 30px auto;">

                <asp:Button ID="btnAddStores" Style="position: absolute; float: right; float: right; right: 350px; margin-top: 17px;"
                    runat="server" CssClass="button" Text="THÊM CỬA HÀNG" />
                <asp:Button ID="btnDelete" Style="position: absolute; float: right; float: right; right: 220px; margin-top: 17px; min-width: 50px; width: 83px; height: 35px"
                    runat="server" CssClass="button" Text="XÓA" OnClick="btnDelete_Click" />
                <br />
                <asp:UpdatePanel runat="server">
                    <ContentTemplate>
                        <asp:Label ID="lblTongSoCuaHang" runat="server" Text="Bạn hiện có" CssClass="subheader" Width="100%"></asp:Label>
                        <asp:GridView
                            runat="server"
                            ID="gvMyStores"
                            Width="100%"
                            AutoGenerateColumns="False"
                            BorderColor="#2C7C00" BorderWidth="1px">
                            <AlternatingRowStyle BackColor="#FFFF99" />
                            <Columns>
                                <asp:TemplateField HeaderText="STT">
                                    <ItemTemplate>
                                        <%# Container.DataItemIndex+1 %>
                                    </ItemTemplate>
                                    <ItemStyle Width="50px" />
                                </asp:TemplateField>
                                <asp:BoundField HeaderText="TÊN CỬA HÀNG" DataField="Name">
                                    <ItemStyle Width="250px" CssClass="style" HorizontalAlign="Left" VerticalAlign="Middle" />
                                </asp:BoundField>
                                <asp:BoundField HeaderText="ĐIẠ CHỈ" DataField="Address">
                                    <ItemStyle HorizontalAlign="Left" CssClass="style" VerticalAlign="Middle" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="THAO TÁC" ShowHeader="False">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lbSelect"
                                            runat="server"
                                            CommandArgument='<%# Eval("Code")%>'
                                            CausesValidation="False"
                                            OnClick="lbSelect_Click"
                                            Text="Xem"></asp:LinkButton>
                                    </ItemTemplate>
                                    <ItemStyle Width="100px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="CHỌN">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="cbDelete" runat="server" />
                                        <asp:HiddenField ID="hfCode" runat="server" Value='<%# Eval("Code")%>' />
                                    </ItemTemplate>
                                    <ItemStyle Width="80px" />
                                </asp:TemplateField>
                            </Columns>
                            <HeaderStyle BackColor="#00A8DF" ForeColor="White" Height="35px" HorizontalAlign="Center" VerticalAlign="Middle" Font-Italic="False" Font-Size="15pt" />
                            <RowStyle Height="35px" Font-Size="13pt" HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:GridView>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnClose" EventName="Click" />
                    </Triggers>
                </asp:UpdatePanel>
            </div>
        </div>
    </div>
    <ajaxToolkit:ConfirmButtonExtender runat="server" ConfirmText="Bạn có chắc là muốn xóa không?" TargetControlID="btnDelete">
    </ajaxToolkit:ConfirmButtonExtender>
    <ajaxToolkit:ModalPopupExtender
        ID="PopupUpdate"
        runat="server"
        PopupControlID="PanelLocationStore"
        TargetControlID="hidden"
        BackgroundCssClass="modalBackground" />

    <asp:Panel
        ID="PanelLocationStore"
        runat="server"
        CssClass="modalPopup"
        align="center"
        Style="display: none"
        Width="95%"
        Height="85%"
        HorizontalAlign="Center">
        <div style="float: right; position: absolute; margin-top: -30px; margin-right: -20px; right: 1px;">
            <asp:ImageButton ID="btnClose" ImageUrl="~/images/web/Close.png" runat="server"
                Height="30px" Width="30px" OnClick="btnClose_Click" />
        </div>
        <asp:HiddenField ID="hidden" runat="server" />
        <asp:UpdatePanel runat="server">
            <ContentTemplate>
                <iframe width="100%" id="iFrame" runat="server" height="545px" src="GoogleMapUpdate.aspx" style="float: left;"></iframe>
            </ContentTemplate>
        </asp:UpdatePanel>
    </asp:Panel>

    <ajaxToolkit:ModalPopupExtender
        ID="PopupAdd"
        runat="server"
        PopupControlID="PanelAdd"
        TargetControlID="btnAddStores"
        BackgroundCssClass="modalBackground" />
    <asp:Panel
        ID="PanelAdd"
        runat="server"
        CssClass="modalPopup"
        align="center"
        Style="display: none"
        Width="95%"
        Height="85%"
        HorizontalAlign="Center">
        <div style="float: right; position: absolute; margin-top: -30px; margin-right: -20px; right: 1px;">
            <asp:ImageButton ID="btnCloseAdd" ImageUrl="~/images/web/Close.png" runat="server"
                Height="30px" Width="30px" OnClick="btnCloseAdd_Click" />
        </div>
        <iframe width="100%" id="iFrame1" runat="server" height="545px" src="GoogleMap.aspx" style="float: left;"></iframe>
    </asp:Panel>
</asp:Content>
